import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/login/Login.vue'
import Home from '../layouts/Home.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'/login'
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      children:[
        {
          path: 'student',
          name: 'student',
          component: ()=>import('../views/student/Student.vue')
        },
        {
          path: 'teacher',
          name: 'teacher',
          component: ()=>import('../views/teacher/Teacher.vue')
        },
        {
          path: 'admin',
          name: 'admin',
          component: ()=>import('../views/admin/Admin.vue')
        }
      ]
    }
  ]
})

export default router
